﻿// -----------------------------------------------------------------------
// <copyright file="FileOptions.cs" company="Company">
// Company 2011
// </copyright>
// -----------------------------------------------------------------------

using System;
using System.Runtime.InteropServices;

namespace Company.IO.Interfaces
{
    /// <summary>
    /// Represents additional options for creating a FileStream object.
    /// </summary>
    [ComVisible(true)]
    [Flags]
    [Serializable]
    public enum FileOptions
    {
        /// <summary>
        /// Indicates that the system should write through any intermediate cache and go directly to disk.
        /// </summary>
        WriteThrough = System.IO.FileOptions.WriteThrough,

        /// <summary>
        /// Indicates no additional parameters.
        /// </summary>
        None = System.IO.FileOptions.None,

        /// <summary>
        /// Indicates that a file is encrypted and can be decrypted only by using the same user account used for encryption.
        /// </summary>
        Encrypted = System.IO.FileOptions.Encrypted,

        /// <summary>
        /// Indicates that a file is automatically deleted when it is no longer in use.
        /// </summary>
        DeleteOnClose = System.IO.FileOptions.DeleteOnClose,

        /// <summary>
        /// Indicates that the file is to be accessed sequentially from beginning to end. 
        /// The system can use this as a hint to optimize file caching. 
        /// If an application moves the file pointer for random access, optimum caching may not occur; 
        /// however, correct operation is still guaranteed. 
        /// </summary>
        SequentialScan = System.IO.FileOptions.SequentialScan,

        /// <summary>
        /// Indicates that the file is accessed randomly. The system can use this as a hint to optimize file caching.
        /// </summary>
        RandomAccess = System.IO.FileOptions.RandomAccess,

        /// <summary>
        /// Indicates that a file can be used for asynchronous reading and writing. 
        /// </summary>
        Asynchronous = System.IO.FileOptions.Asynchronous,
    }
}